using System;
using System.Collections.Generic;
using Matrix.ServiceDiscovery.Enums;

namespace Matrix.ServiceDiscovery.Contracts.Dtos
{
    /// <summary>
    /// 服务实例DTO
    /// </summary>
    public class ServiceInstanceDto
    {
        /// <summary>
        /// 实例ID
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 服务ID
        /// </summary>
        public Guid ServiceId { get; set; }

        /// <summary>
        /// 服务名称
        /// </summary>
        public string ServiceName { get; set; } = string.Empty;

        /// <summary>
        /// 实例ID（业务标识）
        /// </summary>
        public string InstanceId { get; set; } = string.Empty;

        /// <summary>
        /// 主机地址
        /// </summary>
        public string Host { get; set; } = string.Empty;

        /// <summary>
        /// 端口号
        /// </summary>
        public int Port { get; set; }

        /// <summary>
        /// 协议类型
        /// </summary>
        public string Protocol { get; set; } = string.Empty;

        /// <summary>
        /// 权重
        /// </summary>
        public int Weight { get; set; }

        /// <summary>
        /// 健康状态
        /// </summary>
        public HealthStatus HealthStatus { get; set; }

        /// <summary>
        /// 区域
        /// </summary>
        public string? Region { get; set; }

        /// <summary>
        /// 可用区
        /// </summary>
        public string? Zone { get; set; }

        /// <summary>
        /// 标签
        /// </summary>
        public List<string> Tags { get; set; } = new();

        /// <summary>
        /// 元数据
        /// </summary>
        public Dictionary<string, object> Metadata { get; set; } = new();

        /// <summary>
        /// 最后心跳时间
        /// </summary>
        public DateTime? LastHeartbeatTime { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreationTime { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime LastModificationTime { get; set; }
    }
}